home *** CD-ROM | disk | FTP | other *** search
- NODELOCK
- --------
-
- Purpose: This utility is designed for in-house network setups using PCBoard
- v14.5a. In v14.5a the /FLOAT environment switch was added to make setup
- easier for such systems. However, one drawback of the /FLOAT switch is that
- if you want to put all of the user specific files (PCBOARD.SYS) on the
- server then you would run into problems. You may want to keep these files
- on the server for security reasons, because some of the workstations might
- not have hard drives, or your network does not provide a unique directory
- for each user.
-
- NODELOCK allows you to create a lock file for a node when it is in use.
- When that lock file exists no other workstation can access that node until
- the node is unlocked. If a node is locked then NODELOCK will try and find
- a free node. If all of the specified nodes are locked then NODELOCK will
- print a message that notifies the user that all nodes are busy.
-
- Syntax: NODELOCK <lockdir> <startnode> <maxnodes> <minutes>
-
-
- lockdir: This is the directory where you want to store
- the lock files. Examples:
-
- C:\LOCKS
- H:\LOCKS
- G:\PCB\LOCKS
-
- If you specify an invalid directory (i.e. it
- does not exist) then NODELOCK will report
- that all nodes are busy.
-
- startnode: This is the first node to start searching for
- or to create lock files for.
-
-
- maxnodes: The maximum node number to search for or to
- create a lock file. This value must be less
- than or equal to the number of nodes your copy
- of PCBoard supports. For example if you have
- /E25 then do not set this value higher than 25.
-
- minutes: Sometimes a user may not exit properly and
- therefore a lock file is left even though there
- is nobody on the node. This parameter is the
- maximum length of time (in minutes) that a lock
- is considered valid.
-
- You will want this value to be high enough that
- if someone is still online that NODELOCK does
- not think it is an invalid lock and try to use
- that node. For example if most of your users
- can spend 90 minutes online then you may want
- to set this value to 120 just to be safe.
-
- If all nodes are busy then NODELOCK will check
- to see if any of the locks are invalid because
- they are two old. If one is found to be too
- old then it will be deleted and the new caller
- will be logged into that free node.
-
-
- UNLOCK
- ------
-
- Purpose: Removes the locks created by the NODELOCK program. UNLOCK is
- intelligent enough to know which node to unlock.
-
- Syntax: UNLOCK <lockdir>
-
- lockdir: The location where the lock files can be found
- on disk. You should use the same lockdir for
- the UNLOCK program as you did for the NODELOCK
- program.
-
- If you specify an incorrect or invalid directory or a
- directory which does not contain the lock files then
- UNLOCK will report "Unable to remove lock for node x".
- Again, make sure that you specify the same lockdir value
- for UNLOCK and NODELOCK.
-
- Installing NODELOCK:
- --------------------
-
- To install NODELOCK you need to have a copy of PCBoard already running
- and most likely on the server. If you want to create "node" directories
- for each node so that you can use them to store the user specific files.
- Each node directory would most likely contain the node number.
-
- For example, if PCBoard is on the server in the \PCB directory then
- your tree might look like this:
-
- \PCB
- !
- +-- NODE0001
- |
- +-- NODE0002
- |
- +-- NODE0003
- |
- +-- NODE0004
- |
- +-- NODE0005
- |
- --- NODE0006
-
- Now you need to modify your BOARD.BAT so that it runs NODELOCK and
- UNLOCK. This will be the BOARD.BAT that everyone will run so make sure
- that everyone you wish to have access to the BBS also has access to this
- new BOARD.BAT file.
-
- Here is an example BOARD.BAT:
-
- @echo off
- set node=0000
- nodelock f:\locks 5 10 240
- if errorlevel == 99 goto abort
- rem --------------------------------------
- rem Change to the node drive and directory
- rem --------------------------------------
- f:
- cd \pcb\node%NODE%
- rem ---------------------------------------------------
- rem Delete pcboard.sys in case the node was a hung node
- rem ---------------------------------------------------
- del pcboard.sys
- set pcb=/main /swap /node:%NODE%
- set dszlog=pcbdsz.log
- if exist remote.bat rename remote.bat remote.sys
- if exist event.bat rename event.bat event.sys
- if exist door.bat del door.bat
- if exist endpcb del endpcb
- pcb145 /localon /file:f:\pcb\pcboard.dat
- if exist remote.bat remote
- if exist door.bat door
- if exist event.bat event
- if exist endpcb goto end
- board
- :end
- unlock f:\locks
- :busy
- cd\
-
- The above sample creates an environment variable called NODE and sets it to
- 0000. It is important that you define at least four 0s so that you can
- guarantee that there is enough room for the NODELOCK program to set the
- NODE environment variable to reflect the true node number.
-
- Next, the NODELOCK program is run. In this example the locks directory
- is F:\LOCKS but you will probably need to change it to a different location
- based on your network setup. NODELOCK will scan to see if nodes 5 through
- 10 are free. A lock is considered invalid if it is more than 240 minutes
- (4 hours) old.
-
- If all nodes were determined to be busy then NODELOCK will exit with an
- errorlevel of 99. In the example batch file above if the errorlevel is
- 99 then the batch file branches to the "busy" label which simply changes
- to the root directory and ends the batch file.
-
- The next step in the batch file is to change to one of the node directories.
- We will know which directory to change to because the NODE environment
- variable has been set. Before we change to the node directory we first
- change to the appropriate drive. This assures us that we are on the correct
- drive. If not then serious problems could arise when you are unable to
- change to the node directory. The line "cd \pcb\node%NODE%" is the line
- that actually changes the directory.
-
- Once we change to the directory if there is a PCBOARD.SYS file already in
- the directory then the "if exist pcboard.sys del pcboard.sys" line will
- delete the file. There should only be a stray PCBOARD.SYS file if the
- node was a hung and NODELOCK declared the lock invalid.
-
- Next we set the PCB environment variable with a few of PCBoard's
- environment switches. The /main and /swap environment variables are
- covered in the documentation for PCBoard. The /node switch tells PCBoard
- which node it should use.
-
- PCBoard is then loaded. We use the /localon parameter so that the user
- is logged straight in and goes to the "Do you want graphics" prompt. The
- /file parameter is used to point to the location of PCBOARD.DAT. This
- should probably be the same location as your PCBoard installation on the
- server.
-
- Finally, when a user logs off, we go to the end label and so UNLOCK is
- ran and the lock is removed and that node becomes free and waits for the
- next caller.
-
- Common questions:
- -----------------
-
- Is there any "window" when two users could try to occupy the same node and
- therefore cause conflicts?
-
- Yes, however that window (on a 386-33) is far less than 1/20th of a second.
- This window is small enough that should probably not incur any problems.
-